{include file="public_iframe:head"}
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/lang/zh-cn/zh-cn.js"></script>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="ibox float-e-margins">
        <div class="ibox-title">
            <h5>

            </h5>
            <div class="ibox-tools" style="margin-top: -9px;">
                <a href="javascript:history.go(-1);" class="btn btn-primary"><i class="fa fa-arrow-left"></i> 返回</a>
            </div>
        </div>
        <div class="ibox-content">

            <form action="" method="post" enctype="multipart/form-data" id="brandForm" class="form-horizontal">
                    <input type="hidden" name="id" value="{$da.id?$da.id:'';}">

                    <div class="form-group">
                    <label class="col-sm-2 control-label">提成类型</label>
       
                    <div class="col-sm-8">
                     <!--    <label class="checkbox-inline">
                            <input type="radio" name="tc_type"  value="1"  {if condition="isset($da.tc_type) and $da.tc_type=='1'"} checked="checked"{/if}>平台人气
                        </label> -->
                        <label class="checkbox-inline">
                            <input type="radio" name="tc_type"  value="2" {if condition="isset($da.tc_type) and $da.tc_type=='2'"} checked="checked"{/if}>
                            普通会员一级任务提成
                        </label>
                        <label class="checkbox-inline">
                            <input type="radio" name="tc_type"  value="3" {if condition="isset($da.tc_type) and $da.tc_type=='3'"} checked="checked"{/if}>
                            普通会员一级会员充值提成
                        </label>
                        <label class="checkbox-inline">
                            <input type="radio" name="tc_type"  value="4" {if condition="isset($da.tc_type) and $da.tc_type=='4'"} checked="checked"{/if}>
                            普通会员二级任务提成
                        </label>
                        <label class="checkbox-inline">
                            <input type="radio" name="tc_type"  value="5" {if condition="isset($da.tc_type) and $da.tc_type=='5'"} checked="checked"{/if}>
                            普通会员二级会员充值提成
                        </label>

                        <label class="checkbox-inline">
                            <input type="radio" name="tc_type"  value="8" {if condition="isset($da.tc_type) and $da.tc_type=='8'"} checked="checked"{/if}>
                            高级会员一级任务提成
                        </label>
                        <label class="checkbox-inline">
                            <input type="radio" name="tc_type"  value="9" {if condition="isset($da.tc_type) and $da.tc_type=='9'"} checked="checked"{/if}>
                            高级会员一级会员充值提成
                        </label>
                        <label class="checkbox-inline">
                            <input type="radio" name="tc_type"  value="10" {if condition="isset($da.tc_type) and $da.tc_type=='10'"} checked="checked"{/if}>
                            高级会员二级任务提成
                        </label>
                        <label class="checkbox-inline">
                            <input type="radio" name="tc_type"  value="11" {if condition="isset($da.tc_type) and $da.tc_type=='11'"} checked="checked"{/if}>
                            高级会员二级会员充值提成
                        </label>
<!-- 
                        <label class="checkbox-inline">
                            <input type="radio" name="tc_type"  value="6" {if condition="isset($da.tc_type) and $da.tc_type=='4'"} checked="checked"{/if}>
                            区域代理任务提成比例
                        </label> -->
                        <label class="checkbox-inline">
                            <input type="radio" name="tc_type"  value="6" {if condition="isset($da.tc_type) and $da.tc_type=='7'"} checked="checked"{/if}>
                            普通会员区域代理充值提成比例
                        </label>
                        <label class="checkbox-inline">
                            <input type="radio" name="tc_type"  value="7" {if condition="isset($da.tc_type) and $da.tc_type=='8'"} checked="checked"{/if}>
                            高级会员区域代理充值提成比例
                        </label>
                         
                    </div>
                </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">提成比例(请填入数字,单位：%)</label>
                        <div class="col-sm-6">
                            <input type="text" name="tc_price" id="tc_price" value="{$da.tc_price?$da.tc_price:'';}" class="form-control" placeholder="金额" >
                        </div>
                    </div>
               <!--      <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">平台人气</label>
                        <div class="col-sm-6">
                            <input type="text" name="num" id="num" value="{$da.num?$da.num:'';}" class="form-control" placeholder="平台人气" >
                        </div>
                    </div> -->

                    <div class="hr-line-dashed"></div>
                    <div class="form-group">
                        <div class="col-sm-4 col-sm-offset-2">
                            <!--<button class="btn btn-primary" type="submit">提交</button>-->
                            <!--href="JavaScript:void(0);" onclick="roleSubmit();"-->
                            <a href="JavaScript:void(0);" onclick="Submit();" class="btn btn-primary" id="submit">提交</a>
                        </div>
                    </div>
       
            </form>
        </div>
    </div>
    <!-- End Panel Basic -->
</div>
<script>
     function Submit(){
        var formData = new FormData();
        var id = $('input[name="id"]').val();
        var tc_price = $('input[name="tc_price"]').val();
        /*var num = $('input[name="num"]').val();*/
      
        var tc_type = $('input[name="tc_type"]:checked').val();

        formData.append('id',id);
        formData.append('tc_price',tc_price);
       /* formData.append('num',num);*/
        formData.append('tc_type',tc_type);

        $.ajax({
            url:"{:url('Proportion/doedit')}",
            type:'POST',
            data:formData,
            async:false,
            processData:false,
            contentType:false,
            success:function(result) {
                if(result.code == '0'){
                    parent.layer.alert(result.msg);
                }else{
                    parent.layer.msg(result.msg,{
                                icon:1,
                                time:1000,
                            },
                            function (index, item) {
                               window.location.href="{:url('Proportion/lists')}";
                            });
                }
            }
        });
    }
</script>
>
<script type="text/javascript">

    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ue = UE.getEditor('editor');


    function isFocus(e){
        alert(UE.getEditor('editor').isFocus());
        UE.dom.domUtils.preventDefault(e)
    }
    function setblur(e){
        UE.getEditor('editor').blur();
        UE.dom.domUtils.preventDefault(e)
    }
    function insertHtml() {
        var value = prompt('插入html代码', '');
        UE.getEditor('editor').execCommand('insertHtml', value)
    }
    function createEditor() {
        enableBtn();
        UE.getEditor('editor');
    }
</script>
<script type="text/javascript">
    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例
    var ues = UE.getEditor('editor_two');

    function isFocus(e){
        alert(UE.getEditor('editor_two').isFocus());
        UE.dom.domUtils.preventDefault(e)
    }
    function setblur(e){
        UE.getEditor('editor_two').blur();
        UE.dom.domUtils.preventDefault(e)
    }
    function insertHtml() {
        var value = prompt('插入html代码', '');
        UE.getEditor('editor_two').execCommand('insertHtml', value)
    }
    function createEditor() {
        enableBtn();
        UE.getEditor('editor_two');
    }
</script>
</body>

</html>